<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Document</title>
  </head>
  <body>
    <script>
      var age = prompt('请输入需要判断的年龄：');
      var status = age >= 18 ? '已成年' : '未成年';
      console.log(status);
    </script>
  </body>
</html>